import React from 'react';
import {SafeAreaView, ToastAndroid, View} from "react-native";
import { StyleSheet } from 'react-native';
import {
    Button,
    Card,
    Divider,
    Icon,
    Input,
    Layout, List,
    Tab,
    TabView,
    Text,
    TopNavigation,
    TopNavigationAction
} from '@ui-kitten/components';



export const AddTicketSuccessScreen = ({ route,navigation }) => {

    const {cx,ch,cxid,infText,id} = route.params;




    const Header = (props) => (
        <View {...props}>
            <Text category='h6'>{ch}/{cx}</Text>
        </View>
    );
    const navigateAddTicketCollection = () => {
        navigation.navigate('AddTicketCollection');
    };
    const navigateServicingTicket = () => {
        navigation.navigate('ServicingTicket');
    };

    const navigateAddTicketSuccess = () => {
        navigation.navigate('AddTicketSuccess');
    };
    return (
        <SafeAreaView style={{ flex: 1 }}>
            <Card style={styles.card} header={Header} >
                <Text category='h3' >
                    添加成功
                </Text>
                <Layout style={{alignItems:'center',marginTop:20}}>
                    <Text category='h5'>
                        {infText}
                    </Text>
                </Layout>

                <Icon
                    fill='#A4E880'
                    name='checkmark-circle-outline'
                    style={{height:400,marginTop:30}}
                />
            </Card>

                <Button
                    onPress={navigateServicingTicket}
                    style={styles.footerControl}
                    appearance='outline'
                    status='warning'>
                    结束添加
                </Button>

                <Button
                    style={styles.footerControl}
                    onPress={()=>{
                        navigation.navigate('AddTicketCollection',{cx:cx,ch:ch,cxid:cxid,id:id})
                    }
                    }
                >
                    继续添加
                </Button>


        </SafeAreaView>
    );
};



const styles = StyleSheet.create({
    topContainer: {
        flexDirection: 'row',
        justifyContent: 'space-between',
    },
    card: {
        flex: 1,
        margin: 2,
    },
    footerContainer: {
        flexDirection: 'row',
        justifyContent: 'flex-end',
    },
    footerControl: {
        marginHorizontal: 2,
    },
});